package com.hbnu.array;

import java.util.Scanner;

public class DemoArray13 {
    //模拟一个多级菜单
    public static void main(String[] args) {
        linkstart();
    }

    private static void linkstart() {
        System.out.println("欢迎使用黄石阿凯购物管理系统");
        System.out.println("1.登陆系统");
        System.out.println("2.退出");
        System.out.println("******************************");
        System.out.println("请选择，输入数字:");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        if(nxt==1){
            main_sys();
        }
        else {
            quit();
        }
    }

    private static void quit() {
        System.out.println("程序已退出");
    }

    private static void main_sys() {
        System.out.println("黄石阿凯购物管理系统主菜单");
        System.out.println("******************************");
        System.out.println("1.客户信息管理");
        System.out.println("2.真情回顾");
        System.out.println("******************************");
        System.out.println("请选择，输入数字或按0返回上一级菜单:");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        switch (nxt){
            case 1:xinxiguanli();break;
            case 2:zhenqinghuigu();break;
            default:linkstart();
        }
    }

    private static void xinxiguanli() {
        System.out.println("黄石阿凯购物管理系统主菜单>客户信息管理");
        System.out.println("******************************");
        System.out.println("1.添加客户");
        System.out.println("2.修改客户");
        System.out.println("3.删除客户");
        System.out.println("******************************");
        System.out.println("请选择，输入数字或按0返回上一级菜单:");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        switch (nxt){
            case 1:addkehu();break;
            case 2:xiugaikehu();break;
            case 3:deletekehu();break;
            default:main_sys();
        }
    }

    private static void zhenqinghuigu() {
        System.out.println("黄石阿凯购物管理系统主菜单>真情回顾sss");
        System.out.println("******************************");
        System.out.println("1.幸运大放送");
        System.out.println("2.幸运抽奖");
        System.out.println("3.生日问候");
        System.out.println("******************************");
        System.out.println("请选择，输入数字或按0返回上一级菜单:");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        switch (nxt){
            case 1:luck_out();break;
            case 2:luck_duolo();break;
            case 3:birthday_ask();break;
            default:main_sys();
        }
    }

    private static void birthday_ask() {
        System.out.println("执行生日问候");
        System.out.println("输入0返回上一级菜单");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        switch (nxt) {
            default -> zhenqinghuigu();
        }
    }

    private static void luck_duolo() {
        System.out.println("执行幸运抽奖");
        System.out.println("输入0返回上一级菜单");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        switch (nxt) {
            default -> zhenqinghuigu();
        }
    }


    private static void luck_out() {
        System.out.println("执行幸运大放送");
        System.out.println("输入0返回上一级菜单");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        switch (nxt){
            default -> zhenqinghuigu();
        }
    }


    private static void deletekehu() {
        System.out.println("执行删除客户");
        System.out.println("输入0返回上一级菜单");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        switch (nxt){
            default -> xinxiguanli();
        }
    }

    private static void xiugaikehu() {
        System.out.println("执行修改客户");
        System.out.println("输入0返回上一级菜单");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        switch (nxt){
            default -> xinxiguanli();
        }
    }

    private static void addkehu() {
        System.out.println("执行添加客户");
        System.out.println("输入0返回上一级菜单");
        Scanner reader = new Scanner(System.in);
        int nxt = reader.nextInt();
        switch (nxt){
            default -> xinxiguanli();
        }
    }

}
